package org.study.shardingsphere.boot.model;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 参考 https://blog.csdn.net/q736317048/article/details/110284582
 *
 * @author Administrator
 * @date 2022-03-08
 */
@Data
@Builder
@TableName(value = "t_user")
public class User implements Serializable {
    private static final long serialVersionUID = 78199845478048582L;

    /**
     * 用户 id
     */
    @TableId(value = "user_id"/*, type = IdType.AUTO*/)
    private Long userId;

    /**
     * 用户名称
     */
    @TableField(value = "user_name")
    private String userName;

    /**
     * 出生日期
     */
    @TableField(value = "birthday")
    private LocalDateTime birthday;

    /**
     * 电话
     */
    @TableField(value = "phone")
    private String phone;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 最后修改时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 版本号：用于乐观锁，默认为0
     *
     * @return
     */
    //@Version
    @TableField(value = "version")
    private int version;
}
